package com.cgy.utils.netx.client;

import com.cgy.utils.netx.config.ClientConfig;

import java.io.InputStream;

/**
 * @author CHTK
 */
public interface INetworkClientLibrary<Client> {

    /**
     * 初始化
     * @param clientConfig
     * @return
     */
    public INetworkClientLibrary initial(ClientConfig clientConfig, Object...extConfig);

    /**
     * 初始化
     * @param inputStream
     * @return
     */
    public INetworkClientLibrary initial(InputStream inputStream);

    /**
     * 连接
     * @return
     * @throws Exception
     */
    public INetworkClientLibrary connect() throws Exception;

    /**
     * 释放连接
     * @throws Exception
     */
    public void release() throws Exception;

    /**
     * 获取客户端
     * @throws Exception
     * @return
     */
    public Client getClient() throws Exception;
}
